package ex1;


/**
 * Class Update
 * Holds row, coulmn, generation and state of an update from another thread.   
 * Used to communicate between 2 neighboring threads.
 * Stored in outer-queue by a neighbor thread.
 */
public class Update {
	// row and column are the placemnet of updating cell in big board
	private int row;
	private int column;
	private int generation;
	private boolean state;
	
	/**
	 * Update Constructor
	 * @param _row - row of cell sending update
	 * @param _column - column of cell sending update
	 * @param _generation - column of cell sending update
	 * @param _state - state of cell sending update
	 */
	public Update(int _row, int _column, int _generation, boolean _state) { 
		row = _row;
		column = _column;
		generation = _generation;
		state = _state;
	}
	
	/**
	 * Get row
	 * @return row of updating cell
	 */
	public int getRow() {
		return row;
	}

	/**
	 * Get column
	 * @return column of updating cell
	 */
	public int getColumn() {
		return column;
	}

	/**
	 * Get generation
	 * @return generation of updating cell
	 */
	public int getGeneration() {
		return generation;
	}
	
	/**
	 * Get state
	 * @return state of updating cell
	 */
	public boolean getState() {
		return state;
	}
}
